package com.mr.wordcount.keyvalue;

import java.io.IOException;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

public class WCMapper extends Mapper<Text, Text, Text, LongWritable>{


	// 针对输入的每个keyin-valuein调用一次
	@Override
	protected void map(Text key, Text value, Mapper<Text, Text, Text, LongWritable>.Context context)
			throws IOException, InterruptedException {

		System.out.println("keyin:" + key  + "---valuein:" + value);

		context.write(new Text(key), new LongWritable(1));
	}
}
